<h3>页面广告</h3>

<table>
  <tr>
    <th>广告标志名</th>
    <th>广告描述</th>
    <th>广告类型</th>
    <th>链接</th>
    <th>内容</th>
    <th>图片</th>
    <th>高度</th>
    <th>宽度</th>
  </tr>

<% for advertisement in @advertisements %>
  <tr>
    <td><%=h advertisement.name %></td>
    <td><%=h advertisement.description %></td>
    <td><%=h advertisement.style.style_des %></td>
    <td><%=h advertisement.link %></td>
    <td><%=truncate(h(advertisement.content),:length=>18) %></td>
    <td><%=image_tag advertisement.image_name ? "newsimgs/#{advertisement.image_name}":"no_image" ,:height=>"20"%></td>
    <td><%=h advertisement.height %></td>
    <td><%=h advertisement.width %></td>   
    <td><%= link_to 'Edit', edit_advertisement_path(advertisement) %></td>
    <td><%= link_to 'Destroy', advertisement, :confirm => 'Are you sure?', :method => :delete %></td>
  </tr>
<% end %>
</table>

<br />

<%= link_to 'New advertisement', new_advertisement_path %>
<fieldset class="demo">
  <LEGEND>操作说明：</LEGEND>
  <p>
    用于管理广告。
  </p>
</fieldset>
